<?php

namespace App\Http\Validations\Admin;

use Illuminate\Contracts\Validation\Validator;

class CategoryValidation {
    //验证id
    public function setVersion() {
        return [
            'rules' => ['id'=>['required','integer','min:1']],
            'attributes' => ['id'=>'科目编号'],
            'messages' => ["id"=>"必须为正整数",]
        ];
    }

    //验证提交数据
    public function setVersionID() {
        return [
            'rules' => ['version_id'=>['required']],
            'attributes' => ['version_id'=>'版本编号'],
            'messages' => ["version_id"=>"版本编号必须存在",]
        ];
    }

    //验证后添加的钩子函数
    public function customValidate(Validator $validator) {
        //
    }
}
